/*
 * aqua-firefox-theme
 * buttons.css
 *
 * Copyright (c) 2019 Payson Wallach
 *
 * Released under the terms of the GNU General Public License, version 3
 * (https://gnu.org/licenses/gpl.html)
 */

@import "buttons-fixes.css";
@namespace xul "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";

#appMenu-popup .toolbaritem-combined-buttons toolbarseparator {
  border: 0 !important;
}

/* buttons  */
#nav-bar toolbarbutton:not(#urlbar-zoom-button):not(.subviewbutton),
.subviewbutton.panel-subview-footer,
.panel-footer button,
#downloadsHistory,
#downloadsPanel-mainView .download-state .downloadButton,
#overflowMenu-customize-button,
#appMenu-popup .panel-banner-item,
#appMenu-popup .toolbaritem-combined-buttons toolbarbutton:not(#appMenu-fxa-label),
.subviewbutton-back,
#context-navigation menuitem,
.identity-popup-preferences-button:not(#hack),
.findbar-container toolbarbutton,
#sidebar-switcher-target,
#viewButton,
.close-icon:not(.tab-close-button),
.menulist-label-box,
.expander-down,
.expander-up {
  -moz-appearance: none !important;
  background: var(--aqua-button-background) !important;
  box-shadow: var(--aqua-button-box-shadow) !important;
  border: 1px solid var(--aqua-button-border-color) !important;
  border-bottom-color: var(--aqua-button-border-accent-color) !important;
  border-radius: 5px !important;
  padding: 0 2px !important;
  height: 28px !important;
  max-height: 28px !important;
  min-height: 28px !important;
  min-width: 28px !important;
  color: var(--aqua-toolbar-color) !important;
}

/* buttons with margins */
#nav-bar toolbarbutton:not(#urlbar-zoom-button):not(.subviewbutton) {
  margin: 0 3px !important;
}

/* text buttons */

.subviewbutton.panel-subview-footer,
.panel-footer button,
#downloadsHistory,
#overflowMenu-customize-button,
#appMenu-popup .panel-banner-item,
#appMenu-zoomReset-button:not(#appMenu-fxa-label):not(#hack),
#tracking-protection-preferences-button:not(#hack),
.findbar-container toolbarbutton.findbar-button {
  padding: 2px 16px !important;
  text-align: center !important;
}

.subviewbutton.panel-subview-footer,
.panel-footer button,
#downloadsHistory,
#overflowMenu-customize-button,
#appMenu-popup .panel-banner-item,
#tracking-protection-preferences-button:not(#hack),
.findbar-container toolbarbutton.findbar-button {
  margin: 0 4px 4px !important;
}

.subviewbutton.panel-subview-footer label {
  text-align: center !important;
}

/* drop down buttons */

.menulist-label-box,
#sidebar-switcher-target,
#viewButton {
  padding: 2px 16px !important;
  position: relative;
}

.menulist-label-box:after {
  /* arrow position */
  position: absolute !important;
  right: 8px !important;
  top: 8px !important;
}

#sidebar-switcher-arrow,
#viewButton .button-menu-dropmarker {
  /* arrow position, type b */
  transform: translate(6px, 0)
}

.menulist-label-box:after {
  /* create arrow if icon tag no exist */
  content: "";
}

/* hover buttons */
#nav-bar toolbarbutton:not(#urlbar-zoom-button):not(.subviewbutton):not([open]):not([disabled]):hover,
.subviewbutton.panel-subview-footer:hover,
.panel-footer button:hover,
#downloadsHistory:hover,
#downloadsPanel-mainView .download-state .downloadButton:hover,
#overflowMenu-customize-button:hover,
#appMenu-popup .panel-banner-item:hover,
.subviewbutton-back:hover,
#appMenu-popup .toolbaritem-combined-buttons toolbarbutton:not(#appMenu-fxa-label):not([disabled]):hover,
#context-navigation menuitem:not([disabled]):hover,
.identity-popup-preferences-button:not(#hack):hover,
.findbar-container toolbarbutton:hover,
.findbar-closebutton .toolbarbutton-icon:hover,
#sidebar-switcher-target:hover,
#viewButton:hover,
.close-icon:not(.tab-close-button):hover,
menulist:hover .menulist-label-box,
.expander-down:hover,
.expander-up:hover {
  outline: 0 !important;
  background: var(--aqua-button-hover-background) !important;
}

/* active buttons */
#nav-bar toolbarbutton:not(#urlbar-zoom-button):not([disabled]):not(#hack):active,
#nav-bar toolbarbutton:not(#urlbar-zoom-button):not([disabled])[open],
.subviewbutton.panel-subview-footer:active,
.panel-footer button:active,
#downloadsHistory:active,
#downloadsPanel-mainView .download-state .downloadButton:active,
#overflowMenu-customize-button:active,
#appMenu-popup .panel-banner-item:active,
.subviewbutton-back:not(#hack):active,
#appMenu-popup .toolbaritem-combined-buttons toolbarbutton:not([disabled]):not(#appMenu-fxa-label):active,
#context-navigation menuitem:active:not([disabled]),
.identity-popup-preferences-button:not(#hack):active,
.findbar-container toolbarbutton[checked],
.findbar-container toolbarbutton:active,
#sidebar-switcher-target:active,
#sidebar-switcher-target.active,
#viewButton[open],
.close-icon:not(.tab-close-button):active,
menulist[open] .menulist-label-box,
.expander-down:active,
.expander-up:active {
  background: var(--aqua-button-active-background) !important;
  box-shadow: var(--aqua-button-active-box-shadow) !important;
  border-color: var(--aqua-button-active-border-color) !important;
  border-bottom-color: var(--aqua-button-active-border-color) !important;
  border-top-color: var(--aqua-button-active-border-accent-color) !important;
}

/* disabled buttons */
#nav-bar toolbarbutton:not(#urlbar-zoom-button)[disabled],
#appMenu-popup .toolbaritem-combined-buttons toolbarbutton[disabled],
#context-navigation menuitem[disabled] {
  background: var(--aqua-button-disabled-background) !important;
  border-color: var(--aqua-button-disabled-border-color) !important;
  box-shadow: var(--aqua-button-disabled-box-shadow) !important;
  opacity: 1 !important;
}

#nav-bar toolbarbutton:not(#urlbar-zoom-button)[disabled] image,
#appMenu-popup .toolbaritem-combined-buttons toolbarbutton[disabled] image,
#context-navigation menuitem[disabled] image {
  opacity: .4 !important;
}

#nav-bar toolbarbutton:not(#urlbar-zoom-button)[disabled]:hover,
#appMenu-popup .toolbaritem-combined-buttons toolbarbutton[disabled]:hover {
  background: var(--aqua-button-disabled-background) !important;
}

/* inactive window buttons */
#nav-bar toolbarbutton:not(#urlbar-zoom-button):not(.subviewbutton):-moz-window-inactive,
.findbar-container toolbarbutton:-moz-window-inactive,
#sidebar-switcher-target:-moz-window-inactive,
#viewButton:-moz-window-inactive {
  background: var(--aqua-inactive-button-background) !important;
  box-shadow: var(--aqua-inactive-button-box-shadow) !important;
  border-color: var(--aqua-inactive-button-border-color) !important;
}

/* flat buttons */
.subviewbutton-back:not(#hack),
.close-icon:not(.tab-close-button) {
  background: transparent !important;
  box-shadow: none !important;
  border-color: transparent !important;
  border-radius: 5px !important;
}

.subviewbutton-back:not(#hack):not(:active):hover,
.close-icon:not(.tab-close-button):not(:active):hover {
  box-shadow: var(--aqua-button-box-shadow) !important;
  border-color: var(--aqua-button-border-color) !important;
  border-bottom-color: var(--aqua-button-border-accent-color) !important;
}

/* circle buttons */
#downloadsPanel-mainView .download-state .downloadButton {
  border-radius: 100% !important;
}

/* combined buttons */

#nav-bar .toolbaritem-combined-buttons toolbarbutton:not(:last-of-type):not(#hack),
.subviewbutton.panel-subview-footer:not(:only-of-type):not(:last-of-type),
.panel-footer button:not(:only-of-type):not(:last-of-type),
#appMenu-popup .toolbaritem-combined-buttons toolbarbutton:not(:last-of-type):not(#appMenu-zoomEnlarge-button),
#context-navigation menuitem:not(:last-of-type),
.findbar-container toolbarbutton.findbar-find-previous {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  border-right-width: 0 !important;
  margin-right: 0 !important;
}

#nav-bar .toolbaritem-combined-buttons toolbarbutton:not(:first-of-type):not(#hack),
.subviewbutton.panel-subview-footer:not(:only-of-type):not(:first-of-type),
.panel-footer button:not(:only-of-type):not(:first-of-type),
#appMenu-popup .toolbaritem-combined-buttons toolbarbutton:not(:first-of-type):not(#appMenu-fullscreen-button),
#context-navigation menuitem:not(:first-of-type),
.findbar-container toolbarbutton.findbar-find-previous,
.findbar-container toolbarbutton.findbar-find-next {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  margin-left: 0 !important;
}

#nav-bar #back-button:not(#hack),
#nav-bar #forward-button:not(#hack) {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

#nav-bar .toolbaritem-combined-buttons {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* buttons with suggested action */

#appMenu-popup .panel-banner-item[notificationid="update-restart"],
button.popup-notification-primary-button,
#editBookmarkPanelDoneButton {
  color: white !important;
  background: var(--aqua-button-suggested-action-background) !important;
  border-color: var(--aqua-button-suggested-action-border-color) !important;
  border-bottom-color: var(--aqua-button-suggested-action-border-accent-color) !important;
  box-shadow: var(--aqua-button-suggested-action-box-shadow) !important;
  text-shadow: 0 -1px rgba(0, 0, 0, 0.559216) !important;
}

#appMenu-popup .panel-banner-item[notificationid="update-restart"]:hover,
button.popup-notification-primary-button.popup-notification-button:hover,
#editBookmarkPanelDoneButton:hover {
  background: var(--aqua-button-suggested-action-hover-background) !important;
}

#appMenu-popup .panel-banner-item[notificationid="update-restart"]:active,
button.popup-notification-primary-button.popup-notification-button:active,
#editBookmarkPanelDoneButton:active {
  background: var(--aqua-button-suggested-action-active-background) !important;
  border-color: var(--aqua-button-suggested-action-active-border-color) !important;
  box-shadow: var(--aqua-button-suggested-action-active-box-shadow) !important;
  text-shadow: none !important;
}

/* buttons with destructive action */

#editBookmarkPanelRemoveButton {
  color: white !important;
  background: var(--aqua-button-destructive-action-background) !important;
  border-color: var(--aqua-button-destructive-action-border-color) !important;
  border-bottom-color: var(--aqua-button-destructive-action-border-accent-color) !important;
  box-shadow: var(--aqua-button-destructive-action-box-shadow) !important;
  text-shadow: 0 -1px rgba(0, 0, 0, 0.558275) !important;
}

#editBookmarkPanelRemoveButton:hover {
  background: var(--aqua-button-destructive-action-hover-background) !important;
}

#editBookmarkPanelRemoveButton:active {
  background: var(--aqua-button-destructive-action-active-background) !important;
  border-color: var(--aqua-button-destructive-action-active-border-color) !important;
  box-shadow: var(--aqua-button-destructive-action-active-box-shadow) !important;
}

/* overflow menu button padding */
#widget-overflow-mainView .toolbarbutton-text {
  padding: 1px 8px !important;
}
